package com.ctshk.app.system.controller;


import com.ctshk.common.annotations.OperationLogAnnotation;
import com.ctshk.common.dto.Result;
import com.ctshk.common.enums.OperationLogModel;
import com.ctshk.common.enums.OperationLogType;
import com.ctshk.common.web.support.BaseController;
import com.ctshk.rpc.system.req.DispatchOrderLogPageReq;
import com.ctshk.rpc.system.service.IDispatchOrderLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 谢诗宏
 * @since 2021-05-24
 */
@Api(value = "派单管理-日志", tags = "派单管理-日志")
@RestController
@RequestMapping("/dispatch/order/log")
public class DispatchOrderLogController extends BaseController {
    @DubboReference
    IDispatchOrderLogService dispatchOrderLogService;

    @ApiOperation(value = "查看派单日志", notes = "查看派单日志")
    @OperationLogAnnotation(operModul = OperationLogModel.SYSTEM, operType = OperationLogType.QUERY, operTitle = "查看派单日志", operDesc = "查看派单日志")
    @PostMapping(value = "/page")
    public Result save(@RequestBody @Valid DispatchOrderLogPageReq pageReq) {
        return dispatchOrderLogService.page(pageReq, getCurrentUser().getId());
    }
}
